package com.oglvip.business.remote.service.api;

import com.oglvip.business.dto.GoodsFormDto;
import com.oglvip.business.dto.ResponseData;
import com.oglvip.business.remote.service.Targets;
import com.oglvip.business.remote.service.entity.Goods;
import com.oglvip.business.remote.service.entity.PageData;
import com.oglvip.business.remote.support.annotation.BodyParam;
import com.oglvip.business.remote.support.annotation.RestClient;
import com.oglvip.business.remote.support.request.ContentTypes;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

/**
 * @auther hanchao
 * @date 2017/1/7 15:43
 */
@RestClient(Targets.PLATFORM_API)
@Path("/api/goods")
public interface GoodsService {
    @POST
    @Path("/category/list/forstore")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData categoryList(@FormParam("storeId") Integer storeId);

    @POST
    @Path("/list/forstore")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<PageData<Goods>> list(@FormParam("ticket") String ticket, @FormParam("storeId") int storeId,
                                       @FormParam("goodsName") String goodsName, @FormParam("categoryId") Integer categoryId,
                                       @FormParam("status") Integer status, @FormParam("start") Integer start,
                                       @FormParam("size") Integer size);

    @POST
    @Path("/img/upload")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData uploadImg(@FormParam("imgData") String imgData, @FormParam("type") String type);

    @POST
    @Path("/add")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData addGoods(@BodyParam GoodsFormDto goodsFormDto);

    @POST
    @Path("/modify")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData setGoods(@BodyParam GoodsFormDto goodsFormDto);

    @POST
    @Path("/detail")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData getGoods(@FormParam("goodsId")Integer goodsId);


    @POST
    @Path("/updateStatus")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData updateStatus(@FormParam("ticket")String ticket,@FormParam("goodsIds")String goodsIds,@FormParam("status")Integer status);
}
